<?php
/**
 * Created by PhpStorm.
 * User: 快定
 * Date: 2021/8/24
 * Time: 11:40
 */

class Cate extends AppModel
{
    public function findAll($conditions, $limit, $page)
    {
        $this->setSource('cate');
        $data = $this->find('all', array(
            'conditions' => $conditions,
            'limit' => $limit,
            'page' => $page,
        ));
        return $data;
    }

    public function CountAll($conditions)
    {
        $this->setSource('cate');
        $count = $this->find('count', array(
            'conditions' => $conditions
        ));
        return $count;
    }

    public function add($params)
    {
        $this->setSource('cate');
        $res = $this->save($params);
        return $res;
    }

    public function del($id)
    {
        $this->setSource('cate');
        $res = $this->delete($id);
        return $res;
    }
}